#include "myworker.h"

#include <QDebug>
#include <QThread>

MyWorker::MyWorker(QObject *parent) : QObject{parent} {}

void MyWorker::doWork() {
    qDebug() << QThread::currentThread() << "doWork is called";

    while (0) {
        qDebug() << QThread::currentThread() << "Worker thread running";
        // 执行耗时操作
        QThread::sleep(3);
    }

    qDebug() << QThread::currentThread() << "doWork is finished";
}
